#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_checkBox_study_clicked()
{
    setChoose();
}


void Widget::on_checkBox_game_clicked()
{
    setChoose();
}


void Widget::on_checkBox_work_clicked()
{
    setChoose();
}

void Widget::on_checkBox_date_clicked()
{
    setChoose();
}

void Widget::setChoose()
{
    QString res = "今天你的安排是:";
    if (ui->checkBox_study->isChecked())
        res += " 学习";
    if (ui->checkBox_game->isChecked())
        res += " 玩游戏";
    if (ui->checkBox_work->isChecked())
        res += " 工作";
    if (ui->checkBox_date->isChecked())
        res += " 约会";
    ui->label->setText(res);
}

